package juhouse.glb.area.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import juhouse.glb.area.dao.RoadDao;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

public class RoadAction extends DispatchAction{
	public ActionForward roadList(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		this.roadListPage(request);
		return mapping.findForward("roadList");
	}
	private void roadListPage(HttpServletRequest request)
	{
		//RoadDao dao = new RoadDao();
		//String [][] roadList = dao.getRoadList();
		//request.setAttribute("roadList",roadList);
	}
	public ActionForward cityList(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		this.cityListPage(request);
		return mapping.findForward("cityList");
	}
	private void cityListPage(HttpServletRequest request)
	{
		RoadDao dao = new RoadDao();
		String provinceId = request.getParameter("provinceId");
		String [][] cityList = dao.getCityList(provinceId);
		request.setAttribute("cityList",cityList);
	}
}
